package ${packageEntity};
<#if table.hasDecimal == true>import java.math.BigDecimal;</#if>
<#if table.hasDate == true>import java.util.Date;</#if>
import javax.persistence.Table;
import com.alibaba.fastjson.annotation.JSONField;
import com.ys.annotation.YsField;
import com.ys.entity.base.BaseEntity;
/**
*/
@Table(name="${table.nameTableWithDbo}", catalog="${table.primaryKey}")
public class ${table.nameClass} extends BaseEntity<${table.nameClass}> {

<#list table.listColumn as column>
	<#if column.nameType != "Date">
	@YsField(nameDataBase="${column.nameCol}", nameJava="${column.nameCol?uncap_first}", typeDataBase="${column.typeDataBase}")
	private ${column.nameType} ${column.nameCol?uncap_first};
	<#else>
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	@YsField(nameDataBase="${column.nameCol}", nameJava="${column.nameCol?uncap_first}", typeDataBase="${column.typeDataBase}")
	private ${column.nameType} ${column.nameCol?uncap_first};
	</#if>
</#list>

<#list table.listColumn as column>
	public ${column.nameType} get${column.nameCol?cap_first}() {
		return ${column.nameCol?uncap_first};
	}
	public ${table.nameClass} set${column.nameCol?cap_first}(${column.nameType} ${column.nameCol?uncap_first}) {
		this.${column.nameCol?uncap_first} = ${column.nameCol?uncap_first};
		return this;
	}
</#list>

	public static ${table.nameClass} ${table.nameClass?uncap_first}(
<#list table.listColumn as column>
	<#if column.nameCol != "CreateTime" && column.nameCol != "UpdateTime" && column.nameCol != "Id">
	<#if column.nameCol != "Status">
		${column.nameType} ${column.nameCol?uncap_first},
	<#else>
		${column.nameType} ${column.nameCol?uncap_first}
	</#if>
	</#if>
</#list>
			) {
		${table.nameClass} entity = new ${table.nameClass}();
<#list table.listColumn as column>
	<#if column.nameCol != "CreateTime" && column.nameCol != "UpdateTime" && column.nameCol != "Id">
		entity.set${column.nameCol?cap_first}(${column.nameCol?uncap_first});
	</#if>
</#list>
		return entity;
	}
}